//添加多个参数注意使用[]
layui.use(['form'], function () {

    const form = layui.form;

    //获取父id
    let pid = sessionStorage.getItem("methodPid");

    //监听提交
    form.on('submit(commit)', function (data) {
        let formData = data.field;
        formData['pid'] = pid;
        formData['type'] = 2;

        let result = commonAjax(AUTH_SERVER_URL+'/permission/add', JSON.stringify(formData), 'post');
        if (result.code === 200) {
            layerMsgAddSuccess();
        } else {
            layerMsgAddFail();
        }

        return false;
    });
});